<template>
	<view>
		<view v-for="(item,i) in limitTimeList" :key="i" style="width: 95%;margin: 0 2.5%;margin-top: 6upx;">
			<image :src="item.image" style="border-radius: 20upx;border: 1upx solid #DDDDDD;box-shadow: 1upx 1upx 10upx #DDDDDD;width: 100%;height: 100%;height: 366upx;" @click="jumpgoods(item.id)"></image>
			<!-- <view class="detail">
				<view class="name" style="color: #000000;font-weight: 555;font-size: 30upx;height: 47upx;">{{item.goods_desc}}</view>
				<view class="webkit" style="position: relative;height: 30upx;">
					<text style="font-size: 24upx;color: #aaaaaa;font-weight: 550;" class="flex"> {{item.goods_name}} </text>
					<view style="position: absolute;top: -10upx;right: 20upx;">
						<text style="color: #aaaaaa;padding: 0 5upx;">|</text><text style="font-weight: 555;font-size: 34upx;">￥{{item.cost_price}}</text><text>/</text><text style="text-decoration: line-through;color: #aaaaaa;font-size: 22upx;">{{item.level_price}}</text>
					</view>
				</view>
			</view> -->
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				user_id:'',
				res:[],
				limitTimeList:[],
				
			};
		},
		onLoad:function(){
			uni.showLoading()
			uni.getStorage({
				key: 'user_id',
				success: (res) => {
					this.user_id = res.data
					this.setAjax()
				},
				fail: () => {
					uni.navigateTo({
						url: './index'
					});
				}
			});
		},
		methods:{
			setAjax(){
				var o = this
				// 限时抢购列表
				uni.request({
				    url: 'https://cx.mingmeijt.com/Api/PanicBuying/index',
						method: 'POST',
				    success: (res) => {
							this.limitTimeList = res.data.data
							console.log(this.limitTimeList)
							for(var i=0; i<o.limitTimeList.length; i++) {
								o.limitTimeList[i].image = 'https://cx.mingmeijt.com' + o.limitTimeList[i].image
							}
						}
				});
				uni.hideLoading()
			},
			jumpgoods(orderid) {
				uni.navigateTo({
					url: '/pages/product/product?goodsid=' + orderid
				})
			},
			jump(e){
				uni.navigateTo({
					url: e.currentTarget.dataset.src
				});
			},
		}
	}
</script>

<style>
</style>
